const mysql = require('mysql');

const connection = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: 'root',
    database: 'books'
});

connection.connect();

let _delBookId = 7;
connection.query('DELETE FROM t_book WHERE id = ?',_delBookId, (err, results, fields)=>{
    if (err) throw err;
    console.log('deleted ' + results.affectedRows + ' rows');
    connection.end();
});

// connection.end();